package com.atguigu.java.ai.langchain4j.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author 杨轲
 * @Date 2025/5/9 13:38
 * @Version 1.0
 * @description: 配置文件注入bean最多接受10次记忆绘画
 *
 * 创建@bean对象并且注入到assistant/ChatMemoryAssistant中的
 * @AiService(
 *         wiringMode = EXPLICIT,
 *         chatModel = "qwenChatModel",
 *         chatMemory = "chatMemory"
 * )去了
 */
@Configuration
public class MemoryChatAssistantConfig {
    @Bean
    ChatMemory chatMemory(){
        return  MessageWindowChatMemory.withMaxMessages(10);
    }


}
